package com.knowif.backend.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;

import com.knowif.backend.service.ManagerService;
import com.knowif.system.model.RestBean;

/**
 * @author ：Xh  后台人员
 * @date ：Created in 2019/5/6 0006 20:06
 */
@Controller("/manager")
public class ManagerController {
	
	@Autowired
	private ManagerService managerService;
	
	
	@PostMapping("/login")
	private RestBean<?> login(String username,String password,HttpServletRequest request){
		RestBean<?> restBean = managerService.login(username, password);
		if(RestBean.isOK(restBean.getCode())){
			request.getSession().setAttribute("user", restBean.getresult());
		}
		return restBean;
	}
}
















